﻿using System.Net.Sockets;

namespace XcoAppSpaces.Transport.Sockets.Auth
{
	static class NetworkStreamExtensions
	{
		public static byte[] ReadExactly(NetworkStream stream, int count)
		{
			var buffer = new byte[count];
			int read = 0;
			while (read < count)
				read += stream.Read(buffer, read, count-read);
			return buffer;
		}
	}
}
